package com.vm321.chapter2;

import java.util.Scanner;

/**
 * 026
 * Created by Megatron on 2017/1/17.
 */
public class VariableExchange {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);//创建扫描器
        System.out.println("请输入变量A的值");
        long A = scan.nextLong();//接受第一个变量值
        System.out.println("请输入变量B的值");
        long B = scan.nextLong();//接受第二个变量值
        System.out.println("A="+A+"\tB="+B);
        System.out.println("执行变量交换");
        A = A ^ B;
        B = B ^ A;
        A = A ^ B;
        System.out.println("A="+A+"\tB="+B);
    }
}
